//
//  RelatedTopicCell.m
//  BaseProject
//
//  Created by 王洋 on 2020/12/10.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "RelatedTopicCell.h"

@implementation RelatedTopicCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.mainImageView pp_clipCorners:UIRectCornerAllCorners radius:self.mainImageView.frame.size.height/2];
    });
}

- (void)fillWithModel:(CommunityThemeModel *)model {
    
    [self.mainImageView sd_setImageWithURL:[NSURL URLWithString:model.themeUrl] placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.mainTitleLab.text = model.themeTitle;
    self.subTitleLab.text = [NSString stringWithFormat:@"帖子%ld",(long)model.postCount];
}

@end
